/**
 * @author Nicolas Lusa (lusan@usi.ch)
 */
package ch.usi.inf.pf2.gui.tool;

import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.KeyEvent;

import javax.swing.ImageIcon;
import javax.swing.Icon;

import ch.usi.inf.pf2.circuit.Circuit;
import ch.usi.inf.pf2.gui.Model;
import ch.usi.inf.pf2.gui.Selection;

public abstract class Tool implements MouseListener, MouseMotionListener, KeyListener {

    protected final Model model;
    private final String name;
    private final Icon icon;
    private final Icon iconMouseOver;
    
    
    public Tool(final Model model, final String name, final String iconName, final String iconNameMouseOver) {
        this.model = model;
        this.name = name;
        icon = new ImageIcon(getClass().getResource(iconName));
        iconMouseOver = new ImageIcon(getClass().getResource(iconNameMouseOver));
    }
    
    public String getName() {
        return name;
    }
    
    public Icon getIcon() {
        return icon;
    }
    
    public Icon getIconMouseOver() {
    	return iconMouseOver;
    }
    
    protected final Model getModel() {
        return model;
    }
    
    protected final Selection getSelection() {
        return model.getSelection();
    }
    
    protected final Circuit getCircuit() {
        return model.getCircuit();
    }
    
    public void mouseClicked(MouseEvent e) {
    }
    
    public void mouseEntered(MouseEvent e) {
    }
    
    public void mouseExited(MouseEvent e) {
    }
    
    public void mousePressed(MouseEvent e) {
    }
    
    public void mouseReleased(MouseEvent e) {
    }
    
    public void mouseDragged(MouseEvent e) {
    }

    public void mouseMoved(MouseEvent e) {
    }
    
    public void keyPressed(KeyEvent e) {
    }
    
    public void keyReleased(KeyEvent e) {
    }
    
    public void	keyTyped(KeyEvent e) {
    }
}
